<!-- 设备缺陷记录 sbqxjlList.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script language="javascript" src="<%=contextPath%>/js/sorttable.js"type=""></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/css/sorttable.css">
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.form.js"></script>
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-',
				        {
				            text: '增加',
				            icon:"<%=contextPath%>/images/add.gif",
				            handler:function(){
				            	toDetail('0','002')				            	
				            },
				            hidden:<%=session.getAttribute("btn_addNO_display") != null ? false:true%>
				        },'-',
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%=session.getAttribute("btn_delete_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-',
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        }
				        /**,'-', 
				        {
				            text: '导出',
				            icon:"<%=contextPath%>/images/excel_export.gif",
				            handler:function() {

							var options  = {
										url:'sbqxjlList!setPost.do',
							            type:'post',
           								success:function(data)
            							{

                							document.getElementById("ifrDownLoad").src = "<%=contextPath%>/sbqxjlList!createCvs.do"; 
                							return;
               
            							},
            							error:function(xhr)
            							{
                							alert("业务操作失败。");
            							}							            
							            
							        };
					        
							  $('#frmM').ajaxSubmit(options);
							        
							  return false; 
	
				            }
				        }*/
				        ,'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
				        
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<s:hidden name="searchBean.displayFlag" />		
			<s:hidden name="searchBean.con1" />
			<s:hidden name="searchBean.con5" />
			<s:hidden name="searchBean.con6" />
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						缺陷日期：
					</th>
					<td>
						<input type="text" size="12" readonly="true" name="searchBean.con2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" readonly="true" name="searchBean.con3"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<th>
						变电站：
					</th>
					<td>
						<input type="text" readonly="true" name="searchBean.con4" size="50" id="searchBean.con4" value="${searchBean.con4}"/>
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="选择变电站" 
						onClick="javascript:getBdz('searchBean.con5','searchBean.con4','searchBean.con6')" />
					</td>
				</tr>
				<tr>
					<th>
						缺陷类别：
					</th>
					<td>
						<s:select list="qxlbList" emptyOption="true" onchange="javascript:cmt()" name="searchBean.con7" width="300" listKey="itemId" listValue="itemName"/>
					</td>
					<th></th>
					<td></td>
				</tr>
				</tbody>
			</table>
			
			<hr>
			<table width="100%" id="listtab">
			<thead>
				<tr>
					<td  class="DataTable_Title"  width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</td>
					<td  class="DataTable_Title" style="font-size:12px;font-weight:bold;"  width="120">缺陷日期</td>
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">变电站</td>					
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="70">缺陷内容</td>
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="75">缺陷等级</td>
					
					<td  class="DataTable_Title" style="font-size:12px;font-weight:bold;"  width="280">消缺班组</td>
					<td  class="DataTable_Title" style="font-size:12px;font-weight:bold;"  width="280">消缺时间</td>
					
					<td  class="DataTable_Title" style="font-size:12px;font-weight:bold;"  width="280">消缺负责人</td>
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">消缺成员</td>
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">消缺情况</td>
					<td   class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">遗留问题</td>
					
				</tr>
				</thead>
				<c:forEach items="${list}" var="detail" >
						<c:if test="${searchBean.con15 == detail.id}">
						<tr ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')" style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')" >
					</c:if>
						<td  width="25">
							<input type="checkbox" name="id" value="${detail.id}" />
						</td>
						<td nowrap >
								<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >${detail.reporttime}
									
								</a>
						</td>
						<td width="60">&nbsp;<c:out value="${detail.bdzname}"/></td>
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.content}"/>
						</td>
						<td width="70" >
							&nbsp;<c:if test="${detail.category=='0'}">紧急</c:if>
							<c:if test="${detail.category=='1'}">重大</c:if>
							
						</td>
						
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.xqbzname}"/>
						</td>	
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.xcsj}"/>
						</td>
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.xcrname}"/>
						</td>
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.xqcyname}"/>
						</td>	
						<td style="text-align: left" nowrap>
							<c:out value="${detail.gzpj}"/>
						</td>
						<td style="text-align: left" nowrap>
							<c:out value="${detail.ylwt}"/>
						</td>
					</tr>
				</c:forEach>
				
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="12" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		<iframe id="ifrDownLoad" style="display:none" src=""></iframe>	
		</div>
	</body>
</html>
<script type="text/javascript">
	var st = new SortableTable(document.getElementById("listtab"),["None","String","String","None","None","String","None", "None","String","None"]);
</script>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/sbqxyxqList!getList.do?page=1&c=c&searchBean.con15=";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id,qxly){
				document.frmM.action = "<%=contextPath%>/sbqxjl!initDetail.do?id=" + id+"&qxly=" + qxly+"&ymbz=2";
				uncheck("id");
				document.frmM.submit();
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/sbqxjl!delete.do?searchBean.con15=";
					document.frmM.submit();
		    	}
			}
			
		</script>